package com.eascs.ticket.ticket.service;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.eascs.ticket.common.entity.EntityUtil;
import com.eascs.ticket.common.service.BaseSevice;
import com.eascs.ticket.ticket.entity.TicketStatusChangeLog;

@Service
public class TicketStatusChangeLogService extends BaseSevice {

	@Transactional(transactionManager = "ticketTransactionManager")
	public void insertTicketStatusChangeLog(TicketStatusChangeLog ticketStatusChangeLog) {
		this.proxyDao.insert(ticketStatusChangeLog);
	}

	@Transactional(transactionManager = "ticketTransactionManager")
	public void insertTicketStatusChangeLog(String ticketId, String operator, String statusFrom, String statusTo) {
		TicketStatusChangeLog ticketStatusChangeLog = new TicketStatusChangeLog();
		ticketStatusChangeLog.setTicketId(ticketId);
		ticketStatusChangeLog.setOperator(operator);
		ticketStatusChangeLog.setStatusFrom(statusFrom);
		ticketStatusChangeLog.setStatusTo(statusTo);
		EntityUtil.initInsertEntity(ticketStatusChangeLog);
		this.insertTicketStatusChangeLog(ticketStatusChangeLog);
	}
}
